package Deom2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 周斌
 * Date: 2023-11-19
 * Time: 20:48
 */
public class Base {
    int a;
    int b;
    public void methodB() {
        System.out.println("父类的方法");
    }
}
class Derived extends Base {
    int c;
    public void methodD() {
        System.out.println("子类的方法");
    }
    public void method() {
        a = 100;//是从父类继承过来的
        b = 200;//是从父类继承过来的
        c = 300;//自己本身的
    }

    public static void main(String[] args) {
        Derived derived = new Derived();
        derived.methodB();//父类的方法
        derived.methodD();//子类的方法
    }
}
